package chapter23.homework03;

public abstract class State {
    protected Player player;//玩家
    protected int point;//积分
    protected String rankName;//玩家姓名

    public Player getPlayer() {
        return player;
    }

    public void setPlayer(Player player) {
        this.player = player;
    }

    public int getPoint() {
        return point;
    }

    public void setPoint(int point) {
        this.point = point;
    }

    public String getRankName() {
        return rankName;
    }

    public void setRankName(String rankName) {
        this.rankName = rankName;
    }

    public void ExtraPoints(){//加分
        point += 20;
        checkState(point);
        System.out.println(rankName + "玩家" + player.getName() + "积分增加20," + point);
    }

    public void MinusPoints(){//减分
        point -= 10;
        checkState(point);
        System.out.println(rankName + "玩家" + player.getName() + "积分减少10," + point);
    }

    public abstract void checkState(int point);//查看用户状态...

    public void LeavingMessage(){
        System.out.println( rankName + "留言信息...");
    }

    public void reply(){
        System.out.println(rankName + "回复信息..");
    }

    public void download(){
        System.out.println(rankName + "下载信息...");
    }
}
